#include "data_type.h"
#include "math_operator.h"
#include <algorithm>
#include <iterator>


namespace segment {
Center PointCloud::get_x_min_max(PointCloud &p) {
  std::sort(std::begin(p), std::end(p), compare_x_axis);
  Center q;
  q.x = p.begin();
  q.y = p.end();
  return q;
}

Center PointCloud::get_y_min_max(PointCloud &p) {
  std::sort(std::begin(p), std::end(p), compare_y_axis);
  Center q;
  q.x = p.begin();
  q.y = p.end();
  return q;
}

Center PointCloud::get_z_min_max(PointCloud &p) {
  std::sort(std::begin(p), std::end(p), compare_z_axis);
  Center q;
  q.x = p.begin();
  q.y = p.end();
  return q;
}
}